//
// Created by francklinson on 2021/7/20 AT 0:06.
//
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

class Solution {
public:
    int minPairSum(vector<int> &nums) {
        sort(nums.begin(), nums.end());
        int ans = 0;
        int n = nums.size();
        for (int i = 0; i < n / 2; ++i) {
            ans = max(ans, nums[i] + nums[n - 1 - i]);
        }
        return ans;
    }
};

int main() {
    vector<int> nums{3, 5, 3, 2};
    Solution solution;
    cout << solution.minPairSum(nums) << endl;
    return 0;
}

